<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>用户管理</title>
    <link rel="stylesheet" href="/layui/css/layui.css"></link>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row">
        <div class="layui-col-md12">
            <blockquote class="layui-elem-quote layui-quote-nm">
                <div class="layui-inline">
                    <input class="layui-input" placeholder="名字" id="keyWords"></input>
                </div>
                <button class="layui-btn layui-btn-normal" id="search">
                    <i class="layui-icon layui-icon-search"></i>
                </button>
                <button class="layui-btn layui-btn-normal" id="addUser">添加用户</button>
            </blockquote>
        </div>
        <div class="layui-col-md12">
            <table class="layui-hide" id="table_user" lay-filter="table_user"></table>
        </div>
    </div>
</div>
<script src="/layui/layui.js"></script>
<script>
    layui.use(['element', 'table', 'jquery', 'layer', 'form'], function () {
        var table = layui.table,
            layer = layui.layer,
            $ = layui.jquery,
            form = layui.form,
            element = layui.element;

        //处理类型管理部分的数据信息
        table.render({
            elem: '#table_user',
            url: '/user/getAllUser',
            method: 'get',
            cols: [[
                {type: 'numbers'},
                {field: 'id', title: 'id', align: 'center'},
                {field: 'username', title: '用户名', align: 'center'},
                {field: 'password', title: '密码', align: 'center'}
            ]],
            page: true,
            height: 'full-100',
            limit: 15,
            limits: [15, 20],
            loading: true,
            text: {
                none: '暂无相关数据'
            },
            done: function (res, curr, count) {
                console.log(res)
            },
            id: 'reload_table'//表格的唯一标识，重载用
        })
    })
</script>
</body>
</html>